<?php
/**
 * home components.
 *
 * @package    myarticles
 * @subpackage home
 * @author     Apul Gupta<apulmca2k4@gmail.com>
 */
class homeComponents extends sfComponents
{
    public function executeSearch()
    {
        
    }
    public function executeTopAuthors()
    {

       $rightSidebar = sfConfig::get('app_home_right_sidebar');
       $limit = $rightSidebar['number_of_authors'];
       
       $this->authors          = UserPeer::getTopContributedAuthors($limit);
       $this->novice           = sfConfig::get('app_user_level_novice');
       $this->advancedBeginner = sfConfig::get('app_user_level_advanced_beginner');
       $this->competent        = sfConfig::get('app_user_level_competent');
       $this->proficient       = sfConfig::get('app_user_level_proficient');
    }

    public function executeMostViewedArticles()
    {
        $rightSidebar = sfConfig::get('app_home_right_sidebar');
        $limit = $rightSidebar['number_of_most_viewed'];
        $this->articles = ArticlePeer::doSelectMostViewedArticles($limit);
    }

    public function executeMostDiscussedArticles()
    {
        $rightSidebar = sfConfig::get('app_home_right_sidebar');
        $limit = $rightSidebar['number_of_most_discussed'];
     
        $this->articles = ArticlePeer::doSelectMostDiscussedArticles($limit);
    }

    public function executeCategoryBlock()
    {
        $this->categories = CategoryPeer::doSelectParentChild();
    }
}
?>